#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    Point(){
        cout << "Point()" << endl;
    }

    Point(int x,int y){
        _ix = x;
        _iy = y;
        cout <<"Point(int,int)" << endl;
    }

    Point(int x,int y,int z){
        _ix = x;
        _iy = y + z;
        cout << "Point(int,int,int)" << endl;
    }
    void print(){
        cout << "(" << _ix << ","
            << _iy << ")" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    Point pt(2,3);
    pt.print();
    //原理上，没有对pt2的数据成员进行初始化，那么pt2的数据成员
    //应该是不确定的值，但有时编译器会进行优化
    //并不代表着数据被初始化为0
    Point pt2;
    pt2.print();
    Point pt3(1,2,3);
    pt3.print();

    //通过无参构造创建对象时，不要在对象名后面加括号
    /* Point pt4(); */
    /* pt4.print(); */
}

int main(void){
    test0();
    return 0;
}
